Skip to content

Add new optional parameter SecuredVMOsDiskEncryptionSetId in Restore-AzRecoveryServicesBackupItem #28203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SourabhSomnathGholap
Copy link
Contributor

Description

In this PR I have added new optional parameter SecuredVMOsDiskEncryptionSetId in Restore-AzRecoveryServicesBackupItem. This parameter will take disk encryption set id as input and it will be used for encryption of restored secured VM OS disk.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@SourabhSomnathGholap SourabhSomnathGholap marked this pull request as ready for review July 21, 2025 16:55
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 16:55
Copy link

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new optional parameter CVMOsDiskEncryptionSetId to the Restore-AzRecoveryServicesBackupItem cmdlet for encrypting the OS disk of restored Confidential VMs (secured VMs with managed disks).

  • Adds the CVMOsDiskEncryptionSetId parameter to support disk encryption set specification during VM restore operations
  • Updates help documentation and parameter descriptions for the new encryption functionality
  • Includes comprehensive test coverage for the new parameter with multiple scenarios

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
RestoreAzureRMRecoveryServicesBackupItem.cs Adds the new CVMOsDiskEncryptionSetId parameter and integrates it into restore logic
IaasVmPsBackupProvider.cs Implements backend logic to handle the encryption set ID in restore requests
ParamHelpMsgs.cs Adds help message constant for the new parameter
CmdletParamEnums.cs Adds the new parameter to the RestoreVMBackupItemParams enum
Restore-AzRecoveryServicesBackupItem.md Updates cmdlet documentation with new parameter details
ChangeLog.md Documents the new feature addition
ItemTests.ps1 Adds comprehensive test function for the new parameter
ItemTests.cs Registers the new test in the test framework
Comments suppressed due to low confidence (3)

src/RecoveryServices/RecoveryServices/ChangeLog.md:21

  • The parameter name in the changelog should match the actual parameter name. The changelog uses 'CVMOsDiskEncryptionSetId' but the PR title and description refer to 'SecuredVMOsDiskEncryptionSetId'. Based on the code changes, the correct name is 'CVMOsDiskEncryptionSetId'.
* Added new optional parameter CVMOsDiskEncryptionSetId in Restore-AzRecoveryServicesBackupItem.

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.ps1:1360

  • The parameter name used in the test is 'CVMOSDiskEncryptionSetId' but should be 'CVMOsDiskEncryptionSetId' to match the actual parameter name defined in the cmdlet.
		$restoreJob = Restore-AzRecoveryServicesBackupItem -VaultId $vault.ID -VaultLocation $vault.Location `

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.ps1:1372

  • The parameter name used in the test is 'CVMOSDiskEncryptionSetId' but should be 'CVMOsDiskEncryptionSetId' to match the actual parameter name defined in the cmdlet.
		$restoreJob = Restore-AzRecoveryServicesBackupItem -VaultId $vault.ID -VaultLocation $vault.Location `

@YanaXu
Copy link
Contributor

YanaXu commented Jul 22, 2025

/azp run azure-powershell - security-tools

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants